<template>
  <div class="content">
    <div class="active-content">
      <!--    招聘会-->
      <div class="policy-position">
        <div class="block"></div>
        <div :class="fairActive===1?'active':''" @click="fairActive=1" class="tab-item">现场招聘会</div>
        <div :class="fairActive===2?'active':''" @click="fairActive=2" class="tab-item">网络招聘会</div>
        <div :class="fairActive===3?'active':''" @click="fairActive=3" class="tab-item">校园招聘会</div>
        <div :class="fairActive===3?'active':''" @click="fairActive=3" class="tab-item">校园招聘会</div>
        <div :class="fairActive===3?'active':''" @click="fairActive=3" class="tab-item">校园招聘会</div>
        <div :class="fairActive===3?'active':''" @click="fairActive=3" class="tab-item">校园招聘会</div>
        <div :class="fairActive===3?'active':''" @click="fairActive=3" class="tab-item">校园招聘会</div>
        <div :class="fairActive===3?'active':''" @click="fairActive=3" class="tab-item">校园招聘会</div>
      </div>
    </div>
    <div class="fair">
      <div class="post-top">
        <div class="post" v-for="(item,index) in noticeList1" :key="item.id">
          <div class="post-top1">
            <img src="../../assets/index/cover.png" alt="">
            <div class="ing" v-if="item.status==1">进行中</div>
            <div class="ing1" v-if="item.status==2">已结束</div>
            <div class="post-pay">
              <div class="title">
                {{ item.title }}
              </div>
              <div class="small-title">
                <div class="firm">{{ item.firm }}</div>
                <div class="post1">{{ item.post1 }}</div>
              </div>
            </div>
          </div>
          <!--        <div class="site">{{ item.site }}</div>-->
          <div class="striping"></div>
          <div class="recruiter">
            <div class="time">{{ item.time }}</div>
            <div class="message" @click="skip">进入会场</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {getFairListApi} from "@/api/fair";

export default {
  name: "Fair",
  data(){
    return{
      fairActive:1,
      noticeList1:[]
    }
  },
  methods:{
    skip(){
      this.$router.push({ name: 'Activity' })
    },
    getList() {
      getFairListApi({page:1,limit:16}).then((res) => {
        this.noticeList = res.data.list;
      }).catch((res) => {
        // console.log(res)
      })
    },
  }
}

</script>

<style lang="scss" scoped>
  .post-top{
    display: flex;
    flex-wrap: wrap;
    //justify-content: space-between;
    .post{
      padding: 20px 18px;
      background-color: #fff;
      border-radius: 15px;
      margin-top: 15px;
      width: calc((100% - 45px) /2);
      margin-right: 15px;
      .post-top1{
        position: relative;
        box-sizing: border-box;
        display: flex;
        .ing{
          position: absolute;
          top: 10px;
          left: 10px;
          border-radius: 10px;
          background-color: #498CF3;
          width: 50px;
          height: 20px;
          font-size: 10px;
          text-align: center;
          line-height: 20px;
          color: #fff;
        }
        .ing1{
          position: absolute;
          top: 10px;
          left: 10px;
          border-radius: 10px;
          background-color: #989898;
          width: 50px;
          height: 20px;
          font-size: 10px;
          text-align: center;
          line-height: 20px;
          color: #fff;
        }
        img{
          width: 120px;
          height: 120px;
        }
        .post-pay{
          margin-left: 15px;
          font-size: 26px;
          color: #5493F3;
          .title{
            line-height: 30px;
            font-weight: 800;
            font-size: 20px;
            color: #3F3F3F;
          }
          .small-title{
            display: flex;
            line-height: 60px;
            font-size: 20px;
            color: #919191;
            .firm{
              margin-right: 30px;
            }
          }
        }
      }
      .striping{
        margin-top: 20px;
        width: 100%;
        height: 2px;
        background-color: #D8D8D8;
      }
      .recruiter{
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 20px;
        font-size: 20px;
        .time{

        }
        .message{
          width: 100px;
          height: 40px;
          //background-color: #fff;
          border: 1px solid #649DF4;
          color: #649DF4;
          border-radius: 20px;
          text-align: center;
          line-height: 40px;
        }
    }
    }
    .post:nth-child(3n){
      margin-right: 0;
    }
  }
</style>
